#include "idiom.h"

/**
 * @brief Idiom::Idiom
 * Constructor to Idiom instances, this method launch the values in its attribs.
 * This is the space to put a dictionary.
 */
Idiom::Idiom()
  : it(ENG) {
  windowTitle[ENG] = "Python Http Server Frontend";
  windowTitle[SPA] = "Python Http Server Frontend";

  server[ENG] = "Server";
  server[SPA] = "Servidor";

  folder[ENG] = "Folder";
  folder[SPA] = "Carpeta";

  start[ENG] = "Start";
  start[SPA] = "Iniciar";

  stop[ENG] = "Stop";
  stop[SPA] = "Detener";

  clear[ENG] = "Clear History";
  clear[SPA] = "Limpiar Historial";

  history[ENG] = "History";
  history[SPA] = "Historia";

  settings[ENG] = "Settings";
  settings[SPA] = "Configuracion";

  port[ENG] = "Http Server Port";
  port[SPA] = "Puerto Http";

  idiom[ENG] = "Language";
  idiom[SPA] = "Idioma";

  about[ENG] = "About";
  about[SPA] = "Acerca de";

  started[ENG] = "Started!";
  started[SPA] = "Iniciado!";

  stoped[ENG] = "Stoped!";
  stoped[SPA] = "Detenido!";

  findme[ENG] = "Find me as:";
  findme[SPA] = "Buscame como:";
}

/**
 * @brief Idiom::setIdiomType
 * @param newit
 * This method switch the language between English and Spanish.
 */
void Idiom::setIdiomType(idiomtype newit)     { it = newit; }

/**
 * @brief Idiom::getIdiomType
 * @return
 * This method inquire about the current language setted.
 * return ENG or SPA.
 */
idiomtype Idiom::getIdiomType() { return it; }

/**
 * @brief Idiom::getMethods()
 * @return
 * The below fourteen methods inquire about of attrib values.
 * Its methos are necessary to switch all labels interface between their
 * posible languages.
 */
QString Idiom::getWindowTitle() { return windowTitle[it]; }
QString Idiom::getServer()      { return server[it]; }
QString Idiom::getFolder()      { return folder[it]; }
QString Idiom::getStart()       { return start[it]; }
QString Idiom::getStop()        { return stop[it]; }
QString Idiom::getClear()       { return clear[it]; }
QString Idiom::getHistory()     { return history[it]; }
QString Idiom::getSettings()    { return settings[it]; }
QString Idiom::getPort()        { return port[it]; }
QString Idiom::getIdiom()       { return idiom[it]; }
QString Idiom::getAbout()       { return about[it]; }
QString Idiom::getStarted()     { return started[it]; }
QString Idiom::getStoped()      { return stoped[it]; }
QString Idiom::getFindme()      { return findme[it]; }

